<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>菜单管理</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="../../../elementUI/index.css">
  <link rel="stylesheet" href="../../../css/index.css">
  <link rel="stylesheet" href="../../../component/pear/css/pear.css" />
</head>

<body>
  <div id="app" class="minWidth">
    <el-form :inline="true" :form="form">
      <el-form-item>
        <el-button type="primary" @click="addContract">添加</el-button>
      </el-form-item>
      <el-form-item>
        <el-select placeholder="请选择菜单等级" clearable filterable @change="onSerach" v-model.trim="form.level">
          <el-option label="一级菜单" value="1"></el-option>
          <el-option label="二级菜单" value="2"></el-option>
          <el-option label="三级菜单" value="3"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-select placeholder="请选择菜单权限" clearable filterable @change="onSerach" v-model.trim="form.order">
          <el-option label="全部" value="0"></el-option>
          <el-option label="仅系统管理员" value="1"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-input placeholder="请输入菜单名称" clearable @change="onSerach" v-model.trim="form.Model_Name"></el-input>
      </el-form-item>
    </el-form>

    <el-table :data="tableData" stripe border style="width: 100%">
      <el-table-column align="center" label="序号" width="40" type="index"></el-table-column>
      <el-table-column align="center" prop="Model_Number" width="80" label="菜单编号"></el-table-column>
      <el-table-column align="center" prop="Model_Name" width="100" label="菜单名称"></el-table-column>
      <el-table-column align="center" prop="Level" width="100" label="菜单等级">
        <template v-slot="{row}">
          {{Level(row.Level)}}
        </template>
      </el-table-column>
      <el-table-column align="center" prop="Parent_Name" width="100" label="父级菜单"></el-table-column>
      <el-table-column prop="Url" label="菜单路由"></el-table-column>
      <el-table-column align="center" prop="Icon" width="40" label="图标">
        <template v-slot="{row}">
          <i :class="row.Icon"></i>
        </template>
      </el-table-column>
      <el-table-column align="center" prop="Order_Type" width="140" label="权限">
        <template v-slot="{row}">
          {{row.Order_Type=='0'?'全部':'仅系统管理员'}}
        </template>
      </el-table-column>
      <el-table-column align="center" label="操作" width="180">
        <template v-slot="{row}">
          <el-button type="primary" size="small" @click="editMember(row.Model_Number)">编辑</el-button>
          <el-button type="danger" size="small"  @click="deletMember(row.Model_Number)">删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <el-pagination background v-show="total > 0" @size-change="handleSizeChange" @current-change="handleCurrentChange"
      :current-page="form.page" :page-sizes="[10, 20, 30, 50]" :page-size="form.limit"
      layout="total, sizes, prev, pager, next, jumper" :total="total">
    </el-pagination>
  </div>
  <script type="text/javascript" src="../../../js/jquery-3.6.0.min.js"></script>
  <script type="text/javascript" src="../../../js/jquery.cookie.js"></script>
  <script type="text/javascript" src="../../../js/vue.min.js"></script>
  <script type="text/javascript" src="../../../elementUI/index.js"></script>
  <script type="text/javascript" src="../../../js/utils.js"></script>
  <script type="text/javascript" src="./js/Menu.js"></script>
</body>

</html>